<template>
	<Tag class='jzer-tag' style='border-radius:2px;cursor:pointer;padding:0 3px;margin-right:3px;'
		:color 				= 'color' 
		:class 				= 'class'
		:closable 			= 'isClose' 
		v-model:visible 	= 'visible'
		@close 				= 'close' 
		@click 				= 'click' 
	>{{label}}</Tag>
</template>

<script setup>
	import { Tag } from 'ant-design-vue'
	/* --------------------------- props --------------------------- */
	defineProps({
		color 	: String,
		label 	: String,
		class 	: String,
		isClose : { type:Boolean, default: false}
	})
	
	let visible = $ref( true )
	
	const emit = defineEmit(['close', 'click'])
	const cancel = () => visible = false
	const close = () => {
		visible = true
		emit('close', cancel)
	}
	
	const click = () => emit('click')
</script>